<template>
  <div>
    <!--    标题-->
    <el-row>
      <el-col :span="24"><h1 style="text-align: center;font-family: '华文宋体'">客户管理</h1></el-col>
    </el-row>
    <!--    表格-->
    <el-row>
      <el-col :span="24">
        <el-table :data="cutBean.records" style="width: 100%;border-top: solid 1px black">
          <el-table-column fixed prop="id" label="编号" width="100"/>
          <el-table-column prop="name" label="姓名" width="200"/>
          <el-table-column prop="job" label="职位" width="200"/>
          <el-table-column prop="birthday" label="生日" width="200"/>
          <el-table-column fixed="right" label="操作" width="300">
            <template #default="scope">
              <el-button type="primary" size="small" @click="infoVisible=true">查看
                <el-icon>
                  <Delete/>
                </el-icon>
              </el-button
              >

              <el-button type="primary" size="small" @click="updateVisible=true">修改
                <el-icon>
                  <Grape/>
                </el-icon>
              </el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-col>
    </el-row>
    <!--   分页 -->
    <el-pagination
        v-model:currentPage="cutBean.current"
        v-model:page-size="cutBean.size"
        background
        layout="prev, pager, next, jumper"
        :total="cutBean.total"
        @current-change=""
    />
    <el-row style="margin-top: 20px">
      <el-col :span="5"></el-col>
      <!--      添加按钮-->
      <el-col :span="7">
      </el-col>
      <!--      右边部分-->
      <el-col :span="12"
              style="border: 2px solid black;height:220px;line-height: 20px;text-align: start;font-weight: bold;background-color:whitesmoke ">
        <div>
          <div>
            <div style="display: flex;justify-content: space-around;margin-top: 38px">
              <div >商品名称:
                <el-input style="width: 150px" v-model="findObj.name"/>
              </div>
              <div>起始数量
                <el-input style="width: 150px" v-model="findObj.startNum"/>
              </div>
            </div>

            <div style=" margin-top: 20px;margin-left: 8px">结束数量
              <el-input style="width: 150px" v-model="findObj.endNum"/>
              <span style="margin-left: 38px">销售价</span>
              <el-select v-model="findObj.info" placeholder="请选择" size="" style="width: 150px">
                <el-option label="不限" value="1"></el-option>
                <el-option label="未定销售价" value="2"></el-option>
              </el-select>
            </div>

            <div style="display: flex;justify-content: space-around;margin-top: 20px;margin-left: 8px">
              <div>类别
                <el-select v-model="findObj.type" placeholder="请选择" size="" style="width: 150px">
                  <el-option label="电子产品" value="1"></el-option>
                  <el-option label="未定销售价" value="2"></el-option>
                </el-select>
              </div>
              <div style="width: 150px;margin-left: 20px">
                <el-button type="primary" @click="">查询</el-button>
              </div>

            </div>

          </div>
        </div>
      </el-col>
    </el-row>
    <!--查看-->
    <el-dialog
        v-model="infoVisible"
        title="商品信息"
        width="50%"
    >
      <el-row style="width: 100%;line-height: 40px">
        <el-col :span="4">
          <p>商品编号:</p>
          <p>商品名称: </p>
          <p>品牌: </p>
        </el-col>
        <el-col :span="7">
          <p>{{ productObj.id }}</p>
          <p>{{ productObj.name }}</p>
          <p>{{ productObj.brand }}</p>
        </el-col>
        <el-col :span="4">
        </el-col>
        <el-col :span="7">
          <el-image src="" style="width: 150px;height: 150px"></el-image>
        </el-col>
      </el-row>
      <el-row style="width: 100%;line-height: 40px">
        <el-col :span="4">
          <p>类别:</p>
          <p>最新采购价: </p>
        </el-col>
        <el-col :span="7">
          <p>{{ productObj.type }}</p>
          <p>{{ productObj.buyPrice }}</p>

        </el-col>
        <el-col :span="4">
          <p>库存数量:</p>
          <p>建议销售价: </p>
        </el-col>
        <el-col :span="7">
          <p>{{ productObj.num }}</p>
          <p>{{ productObj.sellPrice }}</p>
        </el-col>
      </el-row>


      <template #footer>
      <span class="dialog-footer">
        <el-button @click="infoVisible = false">确定</el-button>
      </span>
      </template>
    </el-dialog>

    <!--      修改信息弹出框-->
    <el-dialog
        v-model="updateVisible"
        title="商品信息"
        width="50%"
    >
      <el-row style="width: 100%;line-height: 40px">
        <el-col :span="4">
          <p>商品编号:</p>
          <p>商品名称: </p>
          <p>品牌: </p>
        </el-col>
        <el-col :span="7">
          <p>{{ productObj.id }}</p>
          <p>{{ productObj.name }}</p>
          <p>{{ productObj.brand }}</p>
        </el-col>
        <el-col :span="4">
        </el-col>
        <el-col :span="7">
          <el-image src="" style="width: 150px;height: 150px"></el-image>
        </el-col>
      </el-row>
      <el-row style="width: 100%;line-height: 40px">
        <el-col :span="4">
          <p>类别:</p>
          <p>最新采购价: </p>
        </el-col>
        <el-col :span="7">
          <p>{{ productObj.type }}</p>
          <p>{{ productObj.buyPrice }}</p>

        </el-col>
        <el-col :span="4">
          <p>库存数量:</p>
          <p>建议销售价: </p>
        </el-col>
        <el-col :span="7">
          <p>{{ productObj.num }}</p>
          <br>
          <el-input v-model="productObj.sellPrice"/>
        </el-col>
      </el-row>


      <template #footer>
      <span class="dialog-footer">
        <el-button @click="updateVisible = false">返回</el-button>
          <el-button @click="updateVisible = false">修改</el-button>
      </span>
      </template>
    </el-dialog>




  </div>


</template>

<script>
import axios from "axios";

export default {
  data() {
    return {
      cutBean: {
        records: [
          {id: 2, name: "haha", job: "老板", birthday: "1993-02-01"},
          {id: 3, name: "oo", job: "boss", birthday: "1996-02-01"},
          {id: 1, name: "dd", job: "boss2", birthday: "1995-02-01"},
          {id: 4, name: "cc", job: "boss3", birthday: "1994-02-01"},
        ],
        total: 20,
        pages: 5,
        size: 4,
        current: 1
      },
      findObj: {},
      infoVisible: false,
      updateVisible: false,
      productObj: {},



    }
  },
  methods: {},
  created() {

  }
}
</script>

<style scoped>

</style>